package com.itheima.reggie.controller;

import com.itheima.reggie.common.R;
import com.itheima.reggie.entity.OrderDetail;
import com.itheima.reggie.entity.Orders;
import com.itheima.reggie.service.OrderDetailService;
import com.itheima.reggie.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/orderDetail")
public class OrdersDetailController {
    @Autowired
    private OrdersService ordersService;

    /**
     * 查看订单详情
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public R getDetail(@PathVariable Long id){
        Orders detail = ordersService.getById(id);
        return R.success(detail);
    }


}
